//
//  OneChatModelUtil.m
//  oneCommonLib
//
//  Created by SY on 2025/6/23.
//

#import "OneChatModelUtil.h"
#import "MSUserManager.h"
#import "HeaderConfig.h"

@implementation OneChatModelUtil

+(OneChatSetModel*)checkLocalChatSetModel:(NSString*)account{
    if (kStringIsEmpty(account) == YES) {
        account = [MSUserManager sharedManager].userModel.account;
    }
    if (kStringIsEmpty(account)) {
        NSLog(@"checkLocal Model account == nil");
        return nil;
    }
    
    NSString *where = [NSString stringWithFormat:@"where %@=%@ ",bg_sqlKey(@"account"),bg_sqlValue(account)];
    
    NSArray *saveModels = [OneChatSetModel bg_find:chatSetTableName where:where];
    if (saveModels.count >0) {
        return saveModels.firstObject;
    }else{
        return nil;
    }
}
@end
